import { Suspense } from 'react';
import NotFound from '../views/403Found/403Found';

function QuanXian(props) {

    // let Quan = JSON.parse(localStorage.getItem('userinfo'))[0].keys
    let Quan =JSON.parse(localStorage.getItem('userinfo')).keys.split(',')
    let res = Quan.includes(props.perm)

    return (
        <Suspense fallback={<div>loading...</div>}>
            {
                res ? props.children : <NotFound />
            }
        </Suspense>
    )
}
export default QuanXian